package com.dwd.user.controller;

import com.dwd.basic.utils.AjaxResult;
import com.dwd.org.pojo.Employee;
import com.dwd.user.pojo.User;
import com.dwd.user.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: TODO
 * @Author 汶狄
 * @Date 2021/1/16 12:33
 * @Version 1.0
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private IUserService userService;

    @PostMapping("/checkPhone")
    public AjaxResult checkRegistPhone(@RequestBody User user) {
        try {
            userService.checkPhone(user.getPhone());
            return AjaxResult.me();
        } catch (Exception e) {
            e.printStackTrace();
            return new AjaxResult(e.getMessage());
        }
    }




}
